/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Dao;

import HibernateUtil.HibernateUtil;
import Interface.InterfaceEducacionPri;
import Pohos.Educacionpri;
import Pohos.EducacionpriId;
import org.hibernate.Session;
import org.hibernate.Transaction;

/**
 *
 * @author Duvan11
 */
public class DaoEducacionPri implements InterfaceEducacionPri{
    private Session session;

    @Override
    public boolean register(Educacionpri educacionpri) throws Exception {
        session = HibernateUtil.getSessionFactory().openSession();
        Transaction transaction = session.beginTransaction();
        session.save(educacionpri);
        transaction.commit();
        session.close();
        return true;
    }
}
